/**
 * Copyright 2013 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.viettel.core.enumtype;

import java.util.HashMap;
import java.util.Map;

/**
 *  Mo ta muc dich cua lop (interface)
 *  @author: ToanTM1
 *  @version: 2.1
 *  @since: 2.1
 */
public enum MailStatus {
	WAIT(0),
	
	SUCCESS(1),
	
	FAIL(2),
	
	REJECT(3),
	
	BLACK_LIST(4),
	
	LIMIT(5);
	/** The value. */
	private Integer value;
	
	/** The values. */
	private static Map<Integer, MailStatus> values = null;

	/**
	 * Parses the value.
	 * 
	 * @param value
	 *            the value
	 * @return the object type
	 */
	public static MailStatus parseValue(Integer value) {
		if (values == null) {
			values = new HashMap<Integer, MailStatus>(MailStatus.values().length);
			for (MailStatus e : MailStatus.values())
				values.put(e.getValue(), e);
		}
		return values.get(value);
	}

	/**
	 * Gets the value.
	 * 
	 * @return the value
	 */
	public Integer getValue() {
		return value;
	}

	MailStatus(Integer value) {
		this.value = value;
	}
}
